using System.IO;
using System.Security.Policy;
using System.Xml;

namespace ImpEx.Engine
{
    public class FSFile : FSBase
    {
        public FSFile(WSSObject parentObj)
            : base(parentObj)
        {
        }

        public override void ChildrenDelayLoad(object o)
        {
        }

        public override void LoadEntity(object o)
        {
            FileInfo di = (FileInfo)o;
            Name = di.Name;
            LastModifiedDate = di.LastWriteTime;
            Path = di.FullName;

            IsChildrenLoaded = true;
        }

        protected override void ChildrenDelayLoad()
        {
            ChildrenDelayLoad(new FileInfo(Path));
        }

        public override void Export(WSSExport exportEngine)
        {
            base.Export(exportEngine);
            if (this.Exportable)
            {
                exportEngine.ExportFile(this);
            }
        }
    }
}